﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace STX.Web.WebService
{
    /// <summary>
    /// api 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消对下行的注释。
    [System.Web.Script.Services.ScriptService]
    public class api : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }

        #region WebMethod 检测用户名是否重复
        /// <summary>
        /// 检测用户名是否重复
        /// </summary>
        /// <param name="username"></param>
        /// <returns></returns>
        [WebMethod(EnableSession = true)]
        public Dictionary<string, object> ChkUser(string username)
        {
            Dictionary<string, object> dataReturn = new Dictionary<string, object>();
            try
            {
                dataReturn.Add("Result", "OK");
                dataReturn.Add("Message", "");
                goto End;
            }
            catch (Exception e)
            {
                dataReturn.Add("Result", "Error");
                dataReturn.Add("Message", e.Message);
            }

        End:
            return dataReturn;
        }
        #endregion
    }
}
